package controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import model.Model;

import databean.User;


public class VideoAction extends Action {


	public VideoAction(Model model) {
		
	}

	public String getName() { return "video.do"; }

	public String perform(HttpServletRequest request,HttpServletResponse response) {
        
		// Set up the errors list
        List<String> errors = new ArrayList<String>();
        request.setAttribute("errors",errors);
        
        HttpSession session = request.getSession();
        
		try {
	        
			if (session.getAttribute("user") == null) {
				return "user-login.do";
			}
	        
			request.setAttribute("user",(User) request.getSession(false).getAttribute("user"));
			


	        return "video.jsp";
	        
	        
        } catch (Exception e) {
        	errors.add(e.getMessage());
        	return "user-login.do";
        }
        
    }
}



